Loading

Only two routines are needed for adding a new format:
int XXX_desc(IPTR im);
int XXX_load(IPTR im);

the description routine should read (or appears to read) from the stream im->fp and fill three fields in the image structure, i.e., the image width, height and image type im->w, im->h, im->type

The load routine should fill the raster matrix.

In no case should the reading routine close the stream pointed to by im->fp.